<template>
  <c-back-wrap :loading="loading" go-page="市场管理" current-page="详情">
    <QupList :column="3" sep="：" default-value="" label-position="right" label-width="130">
      <QupListItem label="市场编码" :value="detail.marketCode" />
      <QupListItem label="市场名称" :value="detail.marketName" />
      <QupListItem label="市场类型" :value="detail.marketType" dict-type-code="TOBE_MARKET_TYPE" :prop-enum="{domainCode:'marketing',appCode:'slm'}" />
      <QupListItem label="省份" :value="detail.provinceName" />
      <QupListItem label="地市" :value="detail.cityName" />
      <QupListItem label="区县" :value="detail.districtName" />
      <QupListItem label="街道/乡镇" :value="detail.streetName" />
      <QupListItem label="所属办事处" :value="detail.agencyCode" />
      <QupListItem label="办事处名称" :value="detail.agencyName" />
      <QupListItem label="是否有老商家" :value="detail.isOldMerchant" dict-type-code="BOOLEANS" :prop-enum="{domainCode:'marketing',appCode:'slm'}" />
      <QupListItem label="市场属性" :value="detail.marketNatrue" dict-type-code="MARKET_NATURE" :prop-enum="{domainCode:'marketing',appCode:'slm'}" />
      <QupListItem label="是否有遗留问题" :value="detail.isLegacyProblem" dict-type-code="BOOLEANS" :prop-enum="{domainCode:'marketing',appCode:'slm'}" />
      <QupListItem v-if="[1,'1'].includes(detail.isLegacyProblem)" label="遗留问题说明" :value="detail.legacyProblemMsg" :span="24" />
      <QupListItem label="数据来源" :value="detail.dataSource" dict-type-code="CTM_MARKET_DATA_FROM" :prop-enum="{domainCode:'marketing',appCode:'slm'}" />
      <QupListItem label="完成招商" :value="detail.isAttractInvestment" dict-type-code="BOOLEANS" :prop-enum="{domainCode:'marketing',appCode:'slm'}" />
      <QupListItem label="办事处任务分配状态" :value="detail.allocationStatus" dict-type-code="CTM_ALLOCATE_STYLE" :prop-enum="{domainCode:'marketing',appCode:'slm'}" />
      <QupListItem label="启用状态" :value="[1,'1'].includes(detail.enable)?'启用':'停用'" />
      <QupListItem label="城市级别" :value="detail.cityLevel" dict-type-code="CITY_LEVEL" :prop-enum="{domainCode:'marketing',appCode:'slm'}" />
      <QupListItem label="停用原因" :value="detail.discontinuationReason" dict-type-code="CTM_MARKET_DISABLE_TYPE" :prop-enum="{domainCode:'marketing',appCode:'slm'}" />
      <QupListItem label="停用说明" :value="detail.discontinuationRemark" :span="24" />
      <QupListItem label="关联市场编码" :value="detail.associatedMarketCode" />
    </QupList>
    <div class="btn-center">
      <c-button type="primary" @click="handleGoBack">返回</c-button>
    </div>
  </c-back-wrap>
</template>
<script>
import { marketDetail } from '@/api/channelTask2/market'
export default {
  name: 'Detail',
  props: {
    id: {
      type: String,
      default: ''
    }
  },
  data() {
    return {
      detail: {},
      loading: false
    }
  },
  created() {
    this.getDetailData()
  },
  methods: {
    getDetailData() {
      this.loading = true
      return marketDetail(this.id).then(res => {
        this.detail = res.data
      }).finally(() => {
        this.loading = false
      })
    },
    handleGoBack() {
      this.$pageStack.pop()
    }
  }
}
</script>
